﻿using System.Collections.Generic;
using System.Collections.ObjectModel;

namespace UtilZ.Dotnet.Ex.Communication.Net.Web
{
    /// <summary>
    /// Api模板参数
    /// </summary>
    public class ApiTemplatePara
    {
        private readonly int _paraCount;
        /// <summary>
        /// 参数数量
        /// </summary>
        public int ParaCount
        {
            get { return _paraCount; }
        }


        private readonly ReadOnlyCollection<UrlSegment> _urlSegments = null;
        /// <summary>
        /// url段集合
        /// </summary>
        public ReadOnlyCollection<UrlSegment> UrlSegments
        {
            get { return _urlSegments; }
        }



        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="paraCount">参数数量</param>
        /// <param name="urlSegments">参数集合</param>
        public ApiTemplatePara(int paraCount, IList<UrlSegment> urlSegments)
        {
            this._paraCount = paraCount;
            if (urlSegments != null && urlSegments.Count > 0)
            {
                this._urlSegments = new ReadOnlyCollection<UrlSegment>(urlSegments);
            }
        }
    }
}
